package backend

import (
	"github.com/gogf/gf/v2/frame/g"
	"time"
)

type LoginReq struct {
	g.Meta `path:"/login.mhtml" tags:"login" method:"get" summary:"login api"`
}
type LoginRes struct {
}

// LoginDoReq 根据路由后缀.do区分是否是异步请求
type LoginDoReq struct {
	g.Meta   `path:"/login.do" tags:"login" method:"post" summary:"login api"`
	UserName string `p:"username" v:"required|length:5,30#请输入登录账号|账号长度为：min-max位"`
	Password string `p:"password" v:"required#请输入密码"`
	Captcha  string `p:"captcha" v:"required|length:4,6#请输入验证码|验证码长度不够"`
	IdKey    string `p:"idkey" v:"required#验证码KEY不能为空"`
}
type LoginDoRes struct {
	g.Meta `mime:"application/json"`
	Token  string    `json:"token"`
	Expire time.Time `json:"expire"`
}

type LogoutReq struct {
	g.Meta `path:"/logout.mhtml" method:"get"`
}
type LogoutRes struct {
}
